import request from '@/utils/request'
import qs from 'qs'
// 查询分页信息
export const gettablelistapi = params => request.get('mbm-microservice-biz/mbm/config/ccbAccount/page', { params })
// 保存
export const postccbapi = data => request.post('mbm-microservice-biz/mbm/config/ccbAccount/save', data)
// 系统管理 权限管理
// 查询顶层业务组织机构列表
export const getgenjieapi = params => request.get('core/security/biz-organization/manager/list', { params })
// 查询业务组织机构
export const getyewuzhuzhiapi = params => request.get('core/security/biz-organization/child/list', { params })
// 查询下级行政组织机构列表
export const getxiajixinzhenapi = params => request.get('core/security/organization/child/list', { params })
// 创建部门/子公司
export const postbumenapi = data => request.post('core/security/organization/dept', qs.stringify(data))
// 更新组织机构
export const putbumenapi = data => request.post('core/security/organization/put', qs.stringify(data))
// 删除组织机构
export const delbumenapi = data => request.post('core/security/organization/delete', qs.stringify(data))
// 查询系统用户列表
export const getrenyuanlistapi = params => request.get('core/security/user/list', { params })
// 修改系统用户密码
export const putpasswordapi = data => request.post('core/security/user/change-password', qs.stringify(data))
// 系统用户账号删除
export const delyonghuapi = data => request.post('core/security/user/delete', qs.stringify(data))
// 创建系统用户
export const addyonghuapi = data => request.post('core/security/user', qs.stringify(data))
// 修改系统用户基本信息
export const putrenyuanapi = data => request.post('core/security/user/put', qs.stringify(data))
// 查询当前用户可授权角色层级树
export const getthiskeshouapi = () => request.get('core/security/user/grant-role/tree')
// 查询当前用户可授权功能权限层级树
export const getthisgongnengapi = () => request.get('core/security/user/grant-function/tree')
// 查询用户已授权功能列表
export const getyishougobgnengapi = params => request.get('core/security/user/function/list', { params })
// 查询用户已授权角色列表
export const getyishoujueseapi = params => request.get('core/security/user/role/list', { params })
// 系统用户角色授权
export const postjueseshouapi = data => request.post('core/security/user/grant-role', qs.stringify(data))
// 系统用户功能授权
export const postgongnshouapi = data => request.post('core/security/user/grant-function', qs.stringify(data))
// 系统用户功能回收
export const posthuishougongnapi = data => request.post('core/security/user/revoke-function', qs.stringify(data))
// 系统用户角色回收
export const posthuishoujueseapi = data => request.post('core/security/user/revoke-role', qs.stringify(data))
// 系统用户账号解锁
export const postjiesuoyonghuapi = data => request.post('core/security/user/unlock', qs.stringify(data))
// 系统用户账号锁定
export const postsuodingyonghuapi = data => request.post('core/security/user/lock', qs.stringify(data))

// 查询用户可授权菜单列表
export const getuservalwapi = () => request.get('core/security/user-grant-menu/list')
// 查询用户已授权菜单ID列表
export const getkeyusermenuapi = params => request.get('core/security/user/menu-id/list', { params })
// 创建菜单系统用户授权
export const postgrantuserapi = (menuId, userId) => request.post(`core/security/user-menu/grant-user?menuId=${menuId}&userId=${userId}`)
// 删除用户菜单授权
export const deletegrantuserapi = (menuId, userId) => request.post(`core/security/user-menu/grant/delete?menuId=${menuId}&userId=${userId}`)